<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>v-on参数</title>
</head>
<body>
    <div id="app">
<!--    事件方法没有参数    -->
        <button @click="btnClick1">按钮1</button>
<!--    在事件定义时，写函数忽略了小括号，但是方法本身需要一个参数    -->
        <button @click="btnClick2(12)">按钮2</button>
        <button @click="btnClick3">按钮3</button>
        <button @click="btnClick4(1,$event)">按钮4</button>
        <button @click="btnClick5">按钮5</button>
    </div>
</body>
    <script src="../js/vue.js"></script>
    <script>
        const app = new Vue({
            el: '#app',
            data: {
              counter: 0,
            },
            methods: {
                btnClick1() {
                    console.log('按钮1被点击');
                },
                btnClick2(a) {
                    console.log('按钮2被点击:',a);
                },
                btnClick3(event) {
                    console.log('按钮2被点击:',event);
                },
                btnClick4(a,event) {
                    console.log('按钮2被点击:',a,event);
                },
                btnClick5(a,event) {
                    console.log('按钮2被点击:',a,event);
                },
            }
        })
    </script>
</html>